package com.zhiyou.video.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhiyou.video.model.TestModel;
import com.zhiyou.video.service.TestService;

@Controller
@RequestMapping("test")
public class TodayTest {
	 
	@Autowired  TestService service;
	
	@RequestMapping("test.do")
	public String goTestIndex()
	{    
		return "test";
	}
	
	@ResponseBody
	@RequestMapping("data.do")
	public Object test(Model amodel)
	{    
		List<TestModel> result = service.queryTest();
		System.out.println("?????????"+result);
		amodel.addAttribute("result", result);
		
		return "table";
	}

}
